home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio 2000
/
Ham Radio 2000.iso
/
ham2000
/
misc
/
dspice0s
/
relmem.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-21
|
3KB
|
92 lines
/* relmem.f -- translated by f2c (version of 3 February 1990 3:36:42).
You must link the resulting object file with the libraries:
-lF77 -lI77 -lm -lc (in that order)
*/
#include "f2c.h"
/* Common Block Declarations */
struct {
doublereal cpyknt;
integer istack[1], lorg, icore, maxcor, maxuse, memavl, ldval, numblk,
loctab, ltab, ifwa, nwoff, ntab, maxmem, memerr, nwd4, nwd8,
nwd16;
} memmgr_;
#define memmgr_1 memmgr_
/* Table of constant values */
static integer c__5 = 5;
/*< subroutine relmem(ipntr,ksize) >*/
/* Subroutine */ int relmem_(ipntr, ksize)
integer *ipntr, *ksize;
{
static integer isize, jsize;
extern /* Subroutine */ int memadj_(), errmem_();
extern logical memptr_();
extern integer nxtevn_();
/* Parameter adjustments */
--ipntr;
/* Function Body */
/*< implicit double precision (a-h,o-z) >*/
/*< dimension ipntr(1) >*/
/* spice version 2g.6 sccsid=memmgr 3/15/83 */
/*< common /memmgr/ cpyknt,istack(1),lorg,icore,maxcor,maxuse,memavl, >*/
/*< 1 ldval,numblk,loctab,ltab,ifwa,nwoff,ntab,maxmem,memerr,nwd4, >*/
/*< 2 nwd8,nwd16 >*/
/*< logical memptr >*/
/* *** relmem - release part of block */
/* ... check for valid pointer */
/*< if (memptr(ipntr(1))) go to 10 >*/
if (memptr_(&ipntr[1])) {
goto L10;
}
/*< memerr=5 >*/
memmgr_1.memerr = 5;
/*< call errmem(5,memerr,ipntr(1)) >*/
errmem_(&c__5, &memmgr_1.memerr, &ipntr[1]);
/*< 10 isize=ksize*istack(ltab+5) >*/
L10:
isize = *ksize * memmgr_1.istack[memmgr_1.ltab + 4];
/* ... check for valid size */
/*< if (isize.ge.0) go to 20 >*/
if (isize >= 0) {
goto L20;
}
/*< memerr=2 >*/
memmgr_1.memerr = 2;
/*< call errmem(5,memerr,ipntr(1)) >*/
errmem_(&c__5, &memmgr_1.memerr, &ipntr[1]);
/*< 20 jsize=istack(ltab+3) >*/
L20:
jsize = memmgr_1.istack[memmgr_1.ltab + 2];
/*< if (isize.le.jsize) go to 30 >*/
if (isize <= jsize) {
goto L30;
}
/*< memerr=6 >*/
memmgr_1.memerr = 6;
/*< call errmem(5,memerr,ipntr(1)) >*/
errmem_(&c__5, &memmgr_1.memerr, &ipntr[1]);
/*< 30 istack(ltab+3)=istack(ltab+3)-isize >*/
L30:
memmgr_1.istack[memmgr_1.ltab + 2] -= isize;
/*< memavl=memavl+(nxtevn(jsize)-nxtevn(istack(ltab+3))) >*/
memmgr_1.memavl += nxtevn_(&jsize) - nxtevn_(&memmgr_1.istack[
memmgr_1.ltab + 2]);
/*< call memadj >*/
memadj_();
/*< return >*/
return 0;
/*< end >*/
} /* relmem_ */